﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using System.Windows;

namespace nGSO.Tests
{
    [TestFixture]
    public class BaseTest
    {
        [Test, Ignore]
        public void RunGSOAgent()
        {
            GsoEngine engine = new GsoEngine(new GsoConfig());
            engine.StartGSOSolving();
        }

        [Test]
        public void TestMoving()
        {
            Point a = new Point(0,0);
            Point b = new Point(4,4);
            double stepSize = 0.5;

            var vector = new Point(b.X - a.X, b.Y - a.Y);
            var length = Math.Sqrt(vector.X * vector.X + vector.Y * vector.Y);
            var unitVector = new Point(vector.X / length, vector.Y / length);
            var x = new Point(a.X + unitVector.X * stepSize, a.X + unitVector.Y * stepSize);
            //Vector diffVector = agentToMoveToward.Location - agent.Location;
            //diffVector.Normalize();
            //agent.NextLocation = agent.Location + _config.StepSize * (diffVector / diffVector.LengthSquared);


            //Point x = new Point(1, 1);
            //Point y = new Point(4, 2);

            //double a = x.X + (0.04 * (y.X - x.X));
            //double b = x.Y + (0.04 * (y.Y - x.Y));
            //Point a = new Point(1, 1);
            //Point b = new Point(4, 2);



            //double diff = (b.X - a.X) + (b.Y - a.Y);
            //double euclideanNorm = Math.Sqrt(Math.Pow((b.X - a.X), 2) + Math.Pow((b.Y - a.Y), 2));
            //double offset = 0.04 * diff / euclideanNorm;

            //var res = new Point(a.X + offset, a.Y + offset);
            //Vector v = y - x; // x moves towad y

            

           // v.Normalize();

            //Point change = x + v / (0.03 * v.LengthSquared);

            //Point change2 = x + v / (0.03 * v.Length);
        }
    }
}
